/*
 * Copyright 2011 Angel Sanadinov
 *
 * This file is part of VBox WMI.
 *
 * VBox WMI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VBox WMI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VBox WMI.  If not, see <http://www.gnu.org/licenses/>.
 */

package Beans.Responses.DataRetrievalComponents;

import com.sun.xml.ws.commons.virtualbox_3_2.IMediumFormat;

/**
 * This class represents a medium format that is supported by a VirtualBox server.
 *
 * @author Angel Sanadinov
 */
public class MediumFormatDataComponent extends DataRetrievalComponent
{
    private String formatId;    //the id of the format
    private String formatName;  //the name of the format

    /**
     * Constructs the medium format data component using the specified data.
     *
     * @param mediumFormat the medium format data supplied by the VirtualBox server
     */
    public MediumFormatDataComponent(IMediumFormat mediumFormat)
    {
        this.formatId = mediumFormat.getId();
        this.formatName = mediumFormat.getName();
    }

    /**
     * Retrieves the medium format id.
     *
     * @return the format id
     */
    public String getFormatId()
    {
        return formatId;
    }

    /**
     * Retrieves the medium format name.
     *
     * @return the format name
     */
    public String getFormatName()
    {
        return formatName;
    }

    @Override
    public boolean isValid()
    {
        if(formatId != null && formatName != null)
            return true;
        else
            return false;
    }
}
